/*
 * CClient.h
 *
 *  Created on: 19.07.2009
 *      Author: oli
 */

#ifndef CCLIENT_H_
#define CCLIENT_H_

#include "./IClientCallbacks.h"
#include "./ZoidStuff/CClient_ZoidCom.h"
#include "./ZoidStuff/CLobbyRadio_ZoidCom.h"
#include <exception>
#include <QObject>

class CClient : public QObject, IClientCallbacks
{
        Q_OBJECT
private:
        QObject* m_pConfigDialog;
        bool m_bClientstarted;
        ZoidCom* m_pZoidCommunicator;
        CZoidClient* m_pZoidClient;
        void AttemptConnection();
        void RegisterClassesForZoidOP();
        CZoidLobbyRadio* m_pLobbyRadio;
public:
        CClient();
        ~CClient();
        void SetCallbackGUI(QObject* CallbackGUI);
        void SendChatMessage(const char* str);
        void emitChatMessages(QString message);
        void requestZoidNode(ZCom_ClassID _requested_class);

        // The server adress. It has to be in the format "ipadress:port"
        QString ServerAdress;

public slots:
        void start();

signals:
        void emit_UpdateChatWin(QString chatMessage);
};

#endif /* CCLIENT_H_ */
